
public class Price {
	
	int cents;
	
	public Price(int cents)
	{
		this.cents = cents;
	}
	
	public int getCents()
	{
		return cents;
	}
	
	public void setCents(int cents)
	{
		this.cents = cents;
	}
	
	public void addCents(int cents)
	{
		this.cents += cents;
	}
	
	public void subtractCents(int cents)
	{
		this.cents -= cents;
	}
	
	public void addPrice(Price p)
	{
		cents += p.cents;
	}
	
	public void subtractPrice(Price p)
	{
		cents -= p.cents;
	}
	
	public String toString()
	{
		String strToReturn = "$";
		strToReturn += (cents / 100);
		strToReturn += ".";
		String temp = "" + (cents % 100);
		if (temp.length() == 1)
			temp += "0";
		strToReturn += temp;
		return strToReturn;
	}
	
}
